"use client";
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import Client from "./client";
import { useLanguageStore } from "@/store/languageStore"; // 新增：引入语言状态

const geistSans = Geist({
  variable: "--font-geist-sans",
  subsets: ["latin"],
});

const geistMono = Geist_Mono({
  variable: "--font-geist-mono",
  subsets: ["latin"],
});

// export const metadata: Metadata = {
//   title: "My Awesome App",
//   description: "This is an example of a Next.js app with metadata.",
//   keywords: ["Next.js", "SEO", "Metadata"],
//   authors: [{ name: "Alexabder Su ", url: "https://example.com" }],
//   openGraph: {
//     title: "My Awesome App",
//     description:
//       "This is an example of a Next.js app with Open Graph metadata.",
//     url: "https://example.com",
//     siteName: "My Awesome App",
//     images: [
//       {
//         url: "https://example.com/og-image.jpg",
//         width: 1200,
//         height: 630,
//         alt: "My Awesome App OG Image",
//       },
//     ],
//     locale: "zh-CN",
//     type: "website",
//   },
// };

export default function RootLayout({
  children,
}: Readonly<{ children: React.ReactNode }>) {
  const { language } = useLanguageStore(); // 新增：获取当前语言状态

  return (
    <html lang={language}>
      <body
        className={`${geistSans.variable} ${geistMono.variable} antialiased`}
      >
        <Client>{children}</Client>
      </body>
    </html>
  );
}
